'use strict';

layui.define(['setter'], function(exports) {
  var setter = layui.setter;

  exports('store', {
    set: function(key, value) {
      if (!key) return;
      layui.data(setter.tableName, {
        key  : key,
        value: value
      });
    },
    get: function(key) {
      if (!key) return;
      var database = layui.data(setter.tableName);
      return database && database[key];
    },
    del: function(key) {
      if (!key) return;
      layui.data(setter.tableName, {
        key   : key,
        remove: true
      });
    }
  });
});
